gtk/wayland: Add support for idle inhibition in GtkApplication
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Fri, 10 Jul 2020 13:53:05 +0000 (15:53 +0200)
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Tue, 14 Jul 2020 19:47:22 +0000 (21:47 +0200)
commit966ab1152dc9f803024d7f9b9d95f595a8c2b211
tree2b0063e04fbfac1ed56c9588fa5fd76cbfd2f83d
parent74a4432688bd33a203849c696a37d40bf0fd9aaf
gtk/wayland: Add support for idle inhibition in GtkApplication

This feature was previously only supported on DBus compositors, such as
Mutter, this adds support for other compositors such as all of those
based on wlroots.

This implementation prefers the idle-inhibit Wayland protocol to the
DBus version if it is available, since the inhibitor is per-surface
instead of global it allows a finer control over which displays get
dimmed for instance.  For every case not supported by this protocol, a
fallback to the DBus version is used.

It can’t do anything if the GtkWindow isn’t passed, which might warrant
some documentation change to encourage users to not use NULL for this
argument.

This has been tested on Sway.

Fixes #2202.
gtk/gtkapplication-wayland.c